import Vue from 'vue'
import App from './App.vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
import UI_Router from './views/UI_Router'
import Contacts from './views/Contacts'
import About from './views/About'

// 二级路由页面
import All_contacts from './views/Second/All_contacts'
import Alice from './views/Second/Alice'
import Bob from './views/Second/Bob'

// 三级路由页面
import Blog from './views/Third/Blog'
import Fax from './views/Third/Fax'
const routes = [
  {
    path: "/",
    redirect: "/ui_router"
  },
  {
    path: "/ui_router",
    component: UI_Router
  },
  {
    path: "/contacts",
    component: Contacts,
    redirect: "/contacts/all_contacts",
    children: [
      {
        path: "all_contacts",
        component: All_contacts
      },
      {
        path: "alice",
        component: Alice
      },
      {
        path: "bob",
        component: Bob,
        children: [
          {
            path: "blog",
            component: Blog
          },
          {
            path: "fax",
            component: Fax
          }
        ]
      }
    ]
  },
  {
    path: "/about",
    component: About
  }
]
const router = new VueRouter({
  routes
})

Vue.config.productionTip = false

new Vue({
  render: h => h(App),
  router
}).$mount('#app')
